package com.huanletao.spring.aop.aop01;


import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

public class DebugInterceptor implements MethodInterceptor {

    private static Log log = LogFactory.getLog(DebugInterceptor.class);

    public Object invoke(MethodInvocation invocation) throws Throwable {
        log.info("Before: invocation=[" + invocation + "]");
        Object rval = invocation.proceed();
        log.info("Invocation returned");
        return rval;
    }

}